package com.bf.electroplating.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bf.electroplating.pojo.dto.IdDTO;
import com.bf.electroplating.pojo.vo.ResultVO;
import com.bf.electroplating.pojo.vo.rainfallOutletMonitoring.RainfallOutletDetailDTO;
import com.bf.electroplating.pojo.vo.rainfallOutletMonitoring.RainfallOutletMonitoringQueryDTO;
import com.bf.electroplating.pojo.vo.rainfallOutletMonitoring.RainfallOutletMonitoringVO;
import com.bf.electroplating.pojo.vo.rainfallOutletMonitoring.RainfallOutletOperationDTO;
import com.bf.electroplating.service.IRainfallOutletMonitoringService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * <p>
 * 雨排口监控表 前端控制器
 * </p>
 *
 * @author gzd
 * @since 2025-08-22
 */
@Tag(name = "雨排口监控表")
@RestController
@RequestMapping("/electroplating/rainfallOutletMonitoring")
public class RainfallOutletMonitoringController {

    @Resource
    private IRainfallOutletMonitoringService rainfallOutletMonitoringService;

    @PostMapping( "/pageList" )
    @Operation( summary = "分页查询雨排口监控列表", description = "分页查询雨排口监控列表" )
    public ResultVO<Page<RainfallOutletMonitoringVO>> pageList (@RequestBody RainfallOutletMonitoringQueryDTO queryDTO ) {
        return rainfallOutletMonitoringService.pageList ( queryDTO );
    }


    @PostMapping ( "/detail" )
    @Operation ( summary = "获取雨排口监控详情", description = "获取雨排口监控详情" )
    public ResultVO < RainfallOutletMonitoringVO > getDetail ( @RequestBody RainfallOutletDetailDTO rainfallOutletDetailDTO ) {
        return rainfallOutletMonitoringService.getDetail (rainfallOutletDetailDTO );
    }


    @PostMapping ( "/export" )
    @Operation ( summary = "导出雨排口监控详情", description = "导出雨排口监控详情" )
    public void   export (HttpServletResponse httpServletResponse, @RequestBody RainfallOutletDetailDTO rainfallOutletDetailDTO ) throws IOException {
        rainfallOutletMonitoringService.export ( rainfallOutletDetailDTO ,httpServletResponse );
    }

    @PostMapping ( "/operation" )
    @Operation ( summary = "操作雨排口", description = "操作雨排口" )
    public ResultVO   operation ( @RequestBody RainfallOutletOperationDTO rainfallOutletOperationDTO ) throws IOException {
        return rainfallOutletMonitoringService.operation ( rainfallOutletOperationDTO );
    }

}
